class JQOAuth2{
	static loginWx(){
		
	}
	
	static async loginWeixin(appid, secret, code,isMA){
		
		
		let  url='https://api.weixin.qq.com/sns/oauth2/access_token?appid='+appid+
		'&secret='+secret+'&code='+code+'&grant_type=authorization_code';
		
		if(isMA){
			  url='https://api.weixin.qq.com/sns/jscode2session?appid='+appid+
		        '&secret='+secret+'&js_code='+code+'&grant_type=authorization_code';
		}
		
		let result = await global.JQHttpContent.get(url,null,true);
		return result;
	
	}
	
	
	
	
}
	
module.exports = JQOAuth2;
